home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PASANS.ZIP / CH06_1.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-04  |  736b  |  34 lines

  1.                             (* Chapter 6 - Programming exercise 1 *)
  2. program First_Array;
  3.  
  4. var Numbers : array[1..12] of integer;
  5.     Index   : integer;
  6.  
  7. begin
  8.    for Index := 1 to 12 do
  9.       Numbers[Index] := Index + 200;
  10.  
  11.    for Index := 1 to 12 do
  12.       Writeln('Element',Index:3,' has the value',Numbers[Index]:4);
  13. end.
  14.  
  15.  
  16.  
  17.  
  18. { Result of execution
  19.  
  20. Element  1 has the value 201
  21. Element  2 has the value 202
  22. Element  3 has the value 203
  23. Element  4 has the value 204
  24. Element  5 has the value 205
  25. Element  6 has the value 206
  26. Element  7 has the value 207
  27. Element  8 has the value 208
  28. Element  9 has the value 209
  29. Element 10 has the value 210
  30. Element 11 has the value 211
  31. Element 12 has the value 212
  32.  
  33. }
  34.